#include<bits/stdc++.h>
using namespace std;
#define N 110
int a[N];
int n;
int main(){
    cin>>n;
    for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + 1 + n);
    int ans = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i + 1; j <= n; j++){
            for(int k = j + 1; k <= n; k++){
                if(a[i] != a[j] && a[i] != a[k] && a[j] != a[k] && a[i] + a[j] > a[k]) ++ans;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}